All Packages Class Hierarchy This Package Previous Next Index
perform(Object, Object)
message.
Function objects are used by many of the algorithms,
ex: accumulate.
You must implement the actual function object with code like this:
public class Sum implements Function2 { public Object perform(Object o1, Object o2) { return new Integer(((Integer)o1).intValue() + ((Integer)o2).intValue()); } }This class will, when used with the
accumulate
function
add together the integer value of each corresponding element in the
two containers. The above example already exist as
sjl.wrappers.FuncSumInteger
.
Copyright © 1996 Finn Bock
public abstract Object perform(Object o1, Object o2)
All Packages Class Hierarchy This Package Previous Next Index